Skip to content

ci(state): install gitleaks in setup-denbust-state-job (unblocks go-live)#224

Merged
shaypal5 merged 2 commits into
mainfrom
codex/ci-install-gitleaks-state-jobs
Jun 17, 2026
Merged

ci(state): install gitleaks in setup-denbust-state-job (unblocks go-live)#224
shaypal5 merged 2 commits into
mainfrom
codex/ci-install-gitleaks-state-jobs

Conversation

@shaypal5

Copy link
Copy Markdown
Member

Why

A latent go-live blocker introduced by #220. scripts/state-run.sh now fails closedscan_state_for_secrets() refuses to commit/push when gitleaks isn't on the runner. But gitleaks was installed only in ci-test.yml; the setup-denbust-state-job composite action — used by every state-writing workflow — never installed it.

Because all eight scheduled state jobs are currently workflow_dispatch-only (pre-go-live), this has been dormant. The moment UNIFY-PR-06 flips the schedules on, each of these would run the job and then fail at the persist step with gitleaks not installed — refusing to push state unscanned:

news-items-discover, daily-state-run, weekly-state-run, news-items-backfill-discover, news-items-backfill-scrape, news-items-monthly-report, news-items-backup, news-items-release.

What

Add a pinned gitleaks install (v8.30.1, matching .gitleaks.toml) to the shared setup-denbust-state-job composite action — one place covers all eight consumers. The read-only news-items-daily-review also uses the action and gets gitleaks harmlessly (a ~2s download it doesn't use). state-repo-squash uses state-squash.sh (which does not scan) and is correctly unaffected.

Verification

  • Confirmed all 8 workflows that invoke state-run.sh use this composite action → all now have gitleaks.
  • action.yml parses as valid YAML; install step mirrors the proven ci-test.yml step.

Why now

This is the prerequisite for the UNIFY-PR-06 go-live dispatch — surfaced while scoping that verification run. Until it lands, a scheduled news-items-discover would run, search/classify, then refuse to persist. With it, the fail-closed guard has its binary and the dispatch can actually exercise the seeded-state → guarded-state-run → Supabase-persist path.

… state-run can persist

After GUARD-PR-SECRET-SCAN (#220), scripts/state-run.sh fails closed — it
refuses to commit/push when gitleaks is absent. gitleaks was installed only in
ci-test.yml, not in the composite action every state-writing workflow uses, so
the eight scheduled state jobs (discover, daily/weekly state-run, backfill-
discover/scrape, monthly-report, backup, release) would all have failed at the
persist step on their first scheduled run.

Add a pinned (v8.30.1, matching .gitleaks.toml) gitleaks install to the shared
setup-denbust-state-job composite action — one place covers all of them.
state-repo-squash uses state-squash.sh (no scan) and is unaffected.

Unblocks the UNIFY-PR-06 go-live dispatch.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 16, 2026 20:34
@shaypal5 shaypal5 added this to the Local↔CI Unification milestone Jun 16, 2026
@shaypal5 shaypal5 added ci security Security hardening / incident follow-up labels Jun 16, 2026
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR unblocks upcoming state-writing GitHub Actions runs by ensuring the shared setup-denbust-state-job composite action installs gitleaks, which scripts/state-run.sh requires for its fail-closed secret-scan guard.

Changes:

  • Add a pinned gitleaks (v8.30.1) install step to the setup-denbust-state-job composite action.
  • Record the change as a completed item in .agent-plan.md to keep the go-live ledger up to date.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
.github/actions/setup-denbust-state-job/action.yml Installs gitleaks on state-job runners so state-run’s secret scan can execute before push.
.agent-plan.md Marks the CI/state-job gitleaks installation work item as done in the plan ledger.

Comment on lines +31 to +33
# Required by scripts/state-run.sh, which fails closed (refuses to push) if
# gitleaks is missing. Every state-writing job runs through state-run, so the
# binary must be present on the runner. Pinned to match .gitleaks.toml's rev.
Comment on lines +36 to +40
run: |
VERSION=8.30.1
curl -fsSL "https://github.com/gitleaks/gitleaks/releases/download/v${VERSION}/gitleaks_${VERSION}_linux_x64.tar.gz" \
| sudo tar -xz -C /usr/local/bin gitleaks
gitleaks version
Comment thread .agent-plan.md
Comment on lines +368 to +369
first scheduled run. Pinned to v8.30.1 to match `.gitleaks.toml`. (`state-repo-squash` uses
`state-squash.sh`, which does not scan, so it is unaffected.) Prerequisite for the `UNIFY-PR-06`
@github-actions

This comment has been minimized.

@codecov

codecov Bot commented Jun 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.84%. Comparing base (33bf2ac) to head (2e4362a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #224   +/-   ##
=======================================
  Coverage   92.84%   92.84%           
=======================================
  Files          84       84           
  Lines       12337    12337           
=======================================
  Hits        11454    11454           
  Misses        883      883           
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown

pr-agent-context report:

This run includes unresolved review comments on PR #224.

For each unresolved review comment, recommend one of: resolve as irrelevant, accept and implement
the recommended solution, open a separate issue and resolve as out-of-scope for this PR, accept and
implement a different solution, or resolve as already treated by the code.

After I reply with my decision per item, implement the accepted actions, resolve the corresponding
PR comments, and push all of these changes in a single commit.

# Copilot Comments

## COPILOT-1
Location: .github/actions/setup-denbust-state-job/action.yml:33
URL: https://github.com/DataHackIL/tfht_enforce_idx/pull/224#discussion_r3423875963
Root author: copilot-pull-request-reviewer

Comment:
    The comment says gitleaks is “pinned to match .gitleaks.toml's rev”, but `.gitleaks.toml` is a config file and doesn’t define a gitleaks version. Consider referencing the actual version pins (CI / pre-commit) to avoid misleading future edits.

## COPILOT-2
Location: .github/actions/setup-denbust-state-job/action.yml:40
URL: https://github.com/DataHackIL/tfht_enforce_idx/pull/224#discussion_r3423876007
Root author: copilot-pull-request-reviewer

Comment:
    The gitleaks install uses a pipeline (`curl | tar`). Adding `set -o pipefail` (and `-e`) makes the step fail reliably if the download fails mid-stream, instead of relying on `tar` to surface the error.

## COPILOT-3
Location: .agent-plan.md:369
URL: https://github.com/DataHackIL/tfht_enforce_idx/pull/224#discussion_r3423876039
Root author: copilot-pull-request-reviewer

Comment:
    This entry says the gitleaks pin “matches `.gitleaks.toml`”, but `.gitleaks.toml` is configuration (not a version pin). It’s clearer to reference the actual gitleaks version pins (pre-commit / CI) so future bumps stay consistent.

Run metadata:

Tool ref: v4.0.19
Tool version: 4.0.19
Trigger: commit pushed
Workflow run: 27646488615 attempt 1
Comment timestamp: 2026-06-16T20:40:52.182467+00:00
PR head commit: 2e4362a23d9ad8e14793fa8faf881f0c53e50a2d

@shaypal5 shaypal5 merged commit be43e02 into main Jun 17, 2026
11 checks passed
@shaypal5 shaypal5 deleted the codex/ci-install-gitleaks-state-jobs branch June 17, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci security Security hardening / incident follow-up

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants